<template>
	<view class="">
		<!-- 轮播图 -->
		<banner :focusList="focusList"></banner>
		<!-- 描述区域 -->
		<view class="desc">
			<view class="ele" v-for="(item,index) in policyDescList" :key="index">
				<img class="icons" :src="item.icon" alt="" />
				<text class="txt">{{item.desc}}</text>
			</view>
		</view>
		<!-- 分类区 -->
		<view class="nav-box">
			<view class="items" v-for="(item,index) in navListStore" :key="index">
				<navigator :url="'/pages/categoryH5page/categoryH5page?url=' + item.schemeUrl">
					<img class="imgs" :src="item.picUrl" />
					<view>{{item.text}}</view>
				</navigator>
			</view>
		</view>
		<!-- 展示区 -->
		<view class="list">
			<view class="img-box">
				<image class="img-1" :src="listDatas.allWidthPic" mode=""></image>
				<image class="img-2" :src="listDatas.qPic" mode=""></image>
			</view>
			<scroll-view class="swp-box" scroll-x>
				<view class="swp-item" v-for="(item,index) in listDatas.kingKongList" :key="index">
					<image class="img-swp" :src="item.picUrl" mode=""></image>
					<view class="txt-swp">{{item.text}}<i v-if="index%2 == 0">,就是用来占位置的呀，就是用来占位置的呀</i></view>
				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	import {
		mapState
	} from "vuex"
	export default {
		props: {
			policyDescList: {
				type: Array,
				default: function() {
					return []
				}
			}
		},
		data(){
			return{
				
			}
		},
		computed: {
			...mapState('Home', ['navListStore', 'allDatas','focusList']),
			listDatas() { //强塞数据
				return {
					...this.allDatas,
					...{
						allWidthPic: 'https://yanxuan.nosdn.127.net/static-union/1716208290b5e9b4.gif?imageView&quality=75&extractGif',
						qPic: 'https://yanxuan-item.nosdn.127.net/6a858a28f1c4a2acf6031ee95e86668c.png?imageView&thumbnail=168x0&quality=75'
					}
				}
			}
		},
	}
</script>

<style lang="less">
	.desc {
		display: flex;
		align-items: center;
		justify-content: space-around;

		.ele {
			height: 40rpx;
			position: relative;

			.icons {
				width: 32rpx;
				height: 32rpx;
				position: absolute;
				top: 6rpx;
				left: 0;
			}

			.txt {
				margin-left: 38rpx;
				font-size: 24rpx;
			}
		}
	}

	.nav-box {
		display: flex;
		flex-wrap: wrap;

		.items {
			width: 20%;
			text-align: center;
			margin-bottom: 20rpx;
			color: #333;

			.imgs {
				width: 100rpx;
				height: 100rpx;
			}
		}
	}

	.list {
		.img-box {
			width: 100%;
			height: 200rpx;
			position: relative;

			.img-1 {
				width: 100%;
				height: 200rpx;
			}

			.img-2 {
				width: 168rpx;
				height: 168rpx;
				position: absolute;
				left: 60rpx;
				top: 14rpx;
			}
		}

		.swp-box {
			height: 200rpx;   // 如果不设置会很高
			white-space: nowrap;   // 必须使用这个
			.swp-item {
				display: inline-block;
				height: 174rpx;
				text-align: center;
				margin-top: 10rpx;
				padding: 0 30rpx;

				.img-swp {
					width: 110rpx;
					height: 110rpx;
				}

				.txt-swp {
					height: 64rpx;
					color: #333;
					font-size: 24rpx;
					width: 110rpx;
					white-space: normal;
					display: -webkit-box;
					-webkit-box-orient: vertical;
					-webkit-line-clamp: 2;
					overflow: hidden;
					text-overflow: ellipsis;
					i{
						font-size: 24rpx;
					}
				}
			}
		}
	}
</style>